package nixonftp.list;


import nixonftp.*;
import java.util.Vector;
import javax.swing.table.AbstractTableModel;

/* nixonFTP
 * FTP client version 0.1
 * Copyright (C) 2010 NIXON Development Corporation.
 * All rights reserved.
 * http://members.shaw.ca/nixon.com
*/

public class NXTableModel extends AbstractTableModel {
	private Vector<NXObjectIndex> objects = new Vector();

	public boolean isCellEditable(int row, int col) {
		return false;
	}

	public int getRowCount() {
		return objects.size();
	}

	public int getColumnCount() {
		return 3;
	}

	public Object getValueAt(int rowIndex, int columnIndex) {
		NXObjectIndex obj = objects.get(rowIndex);
		return obj;
	}

	public NXObjectIndex getValueAt(int rowIndex) {
		return objects.get(rowIndex);
	}

	public void setValueAt(int row, NXObjectIndex obj) {
		objects.set(row, obj);
	}

	public void addRow(NXObjectIndex obj) {
		objects.add(obj);
	}

	public void insertRow(int idx, NXObjectIndex obj) {
		objects.add(idx, obj);
	}

	public void removeRow(Object obj) {
		objects.removeElement(obj);
	}

	public void removeRowAt(int idx) {
		objects.removeElementAt(idx);
	}
}